//
//  ViewController.m
//  11101
//
//  Created by student on 16/3/6.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UIScrollViewDelegate>
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    UIImage *image=[UIImage imageNamed:@"1.jpg"];
    UIImageView *imageView=[[UIImageView alloc]initWithImage:image];
    [self.scrollView addSubview:imageView];
    self.scrollView.contentSize=imageView.image.size;
    self.scrollView.maximumZoomScale=2.0;
    self.scrollView.minimumZoomScale=0.2;
    self.scrollView.showsVerticalScrollIndicator=NO;
    imageView.tag=101;
    
}

- (nullable UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{
    return [self.scrollView viewWithTag:101];
}

@end
